﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  <link href="${ctx.resource}/css/bootstrap-select.min.css" rel="stylesheet">
  <link href="${ctx.resource}/css/shiftform.css" rel="stylesheet">

</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>

  <%@ include file="/WEB-INF/include/menu.jsp"%>

  <div class="container main-content">

    <div class="panel panel-default beast-panel beast-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/system">系统管理</a></li>
          <li class="active">帐号管理</li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 beast-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

        <div class="col-xs-10 beast-panel-layout-right">

          <div class="beast-breadcrumb-wrapper">
            <div class="beast-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire" title="帐号管理"></i>&nbsp;&nbsp;<span>帐号管理&nbsp;-&nbsp;账号列表</span></h2>
            </div>
          </div>
          
          <div class="beast-toolbar-wrapper top-margin-20 clearfix">
            
            <div class="btn-group pull-right">
             <a href="${ctx.host}/principals/create" data-target="#" data-toggle="modal" title="添加账号" class="btn btn-default demo2do-btn btn-shadow btn-shadow-default">
                <i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;添加账号
             </a>
            </div>
          </div>
          
          <table class="table table-striped table-hover demo2do-table bottom-margin-20">
            <thead>
              <tr>
                <th>登录手机号</th>
                <th>显示昵称</th>
                <th>账户权限</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody>
              <c:forEach var="principal" items="${principals}">
                <tr>
                  <td>${principal.mobile}</td>
                  <td>${principal.name}</td>
                  <td>${roles[principal.authority].description}</td>
                  <td>
                    <a href="${ctx.host}/principals/${principal.id}/edit" class="hover-no-text-decoration" data-target="#" data-toggle="modal" title="修改">修改</a>
                    <a href="${ctx.host}/principals/${principal.id}/reset-password" class="hover-no-text-decoration" data-target="#" data-toggle="modal" title="重置密码">重置密码</a>
                  </td>
                </tr>  
              </c:forEach>    
            </tbody>
          </table>
          
        </div>

      </div>

    </div>

  </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/select2.min.js"></script>
  <script src="${ctx.resource}/js/select2_locale_zh-CN.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.trigger.js"></script>
  <script src="${ctx.resource}/js/shiftform.js"></script>

</body>

</html>
